﻿#pragma once
#include "clanlib\gui\gui_component.h"
#include "AdventureDisplay.h"

//enum all button in main menu display
enum BUTTON_TYPE
{
	BUTTON_ADVENTURE,
	BUTTON_MAINMENU,
	BUTTON_EXIT
};


/* main class to display window, if close --> game will end */
class MainMenuDisplay :
	public CL_GUIComponent
{
public:
	//Construction
	MainMenuDisplay(CL_GUIManager *manager, CL_GUITopLevelDescription desc);
	~MainMenuDisplay(void);

private:
	//Attributes
	CL_Texture *mainMenuTexture;
	bool quit; // quit = true --> game will end
	bool stopRender; // stopRender = true --> stop drawn main menu display
	CL_PushButton *advButton; // click on this button --> start adventure display
	AdventureDisplay *advDisplay; // 
	CL_PushButton *mainMenuButton; // click on this button --> back to main menu display

	//--Timing variables---------
	unsigned int lastTime;

	//---------------------------

	//Event functions
	bool on_window_close( MainMenuDisplay *wnd); // when click on ("X") button at top-right corner
	bool on_input(const CL_InputEvent &key,  MainMenuDisplay *wnd); // when window receive input signal from keyboard or mouse
	void on_clicked( BUTTON_TYPE buttonType); // when click on buttons
	
	
	void on_render(CL_GraphicContext &gc,  const CL_Rect &clip_rect); // when display need to be drawn again
	void on_process_message(CL_GUIMessage &message); // when message pass window


};

